﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CSP.MembershipInterface;
using CSP.MembershipInterface.ObjectModel;
using CSP.SimpleCMS.DataModel;

namespace CSP.SimpleCMS
{
    public class MembershipServiceClass : CSP.MembershipInterface.IMembershipServiceContract
    {

        #region IMembershipServiceContract Members

     
        public CaseType[] GetCaseTypes()
        {
            return DataModel.CaseTypeDM.GetCaseTypes();
        }

        public CaseType GetCaseTypeByName(string name)
        {
            return DataModel.CaseTypeDM.GetCaseTypeByName(name);
        }

        public CaseStatus GetInitialCaseStatus()
        {
            return DataModel.CaseStatusDM.GetCaseStatusByCaseStatusID(1);
        }

        public CaseRoleType GetInitialCaseRoleType()
        {
            return DataModel.CaseRoleTypeDM.GetCaseRoleTypeById(1);
        }

        public string AddCase(Case crmCase)
        {
            return CaseDM.AddCase(crmCase);
        }

        public void UpdateCase(Case crmCase)
        {
            CaseDM.UpdateCase(crmCase);
        }

        public void UpdateCaseSatisfaction(string caseID, int satisfaction)
        {
            // TODO: Not implemented with simplecms
        }


        public Case[] GetCases()
        {
            return CaseDM.GetCases();
        }

        public Case[] GetCasesByCaseType(CaseType caseType)
        {
            return CaseDM.GetCasesByCaseType(caseType);
        }

        public Case[] GetCasesByCaseRoleType(CaseRoleType caseRoleType)
        {
            return CaseDM.GetCasesByCaseRoleType(caseRoleType);
        }

        public Case[] GetCasesByCaseStatus(CaseStatus caseStatus)
        {
            return CaseDM.GetCasesByCaseStatus(caseStatus);
        }

        public CaseStatus[] GetCaseStatus()
        {
            return CaseStatusDM.GetCaseStatus ();
        }

        public CaseStatus GetCaseStatusByCaseStatusID(int caseStatusID)
        {
            return CaseStatusDM.GetCaseStatusByCaseStatusID(caseStatusID);
        }

        

        public Case GetCaseByCaseID(string caseID)
        {
            return CaseDM.GetCaseByCaseID(caseID);
        }

        public Case[] GetCasesByCitizenID(string username)
        {
            return CaseDM.GetCasesByCitizenID(username);
        }

        public void AddCitizenRequest(CitizenRequest citizenRequest)
        {
            CitizenRequestDM.AddCitizenRequest(citizenRequest);
        }

        public void ApproveCitizenRequest(string username)
        {
            CitizenRequestDM.ApproveCitizenRequest(username);
        }

        public void DenyCitizenRequest(string username)
        {
            CitizenRequestDM.DenyCitizenRequest(username);
        }

        public Citizen[] GetCitizens()
        {
            return CitizenDM.GetCitizens();
        }

        public Citizen GetCitizenByUsername(string username)
        {
            return CitizenDM.GetCitizenByUsername(username);
        }

        public CitizenRequest[] GetCitizenRequests()
        {
            return CitizenRequestDM.GetCitizenRequests();
        }

        public CitizenRequest GetCitizenRequestByUsername(string username)
        {
            return CitizenRequestDM.GetCitizenRequestByUsername(username);
        }

        #endregion
    }
}
